//
//(C) Copyright 2011 HongKong Airline.,Ltd. 
//
/**
 * consumeHistoryAction
 * 项目名称:代购系统
 * @author Mengxiangliang
 * 功能描述:
 * 历史版本:2013-01-04 v1.0.0 Mengxiangliang  创建:
 * @version [V1] 
 */
package com.gamutsoft.amb.consumehistory.action;

import java.util.List;
import java.util.Map;

import com.gamutsoft.amb.base.action.BaseAction;
import com.gamutsoft.amb.common.bean.QueryExample;
import com.gamutsoft.amb.common.exception.BusinessException;
import com.gamutsoft.amb.common.util.ConditionUtil;
import com.gamutsoft.amb.common.util.PageUtil;
import com.gamutsoft.amb.consumehistory.model.ConsumeHistory;
import com.gamutsoft.amb.consumehistory.service.IConsumeHistoryService;


@SuppressWarnings({"serial","rawtypes"})
public class ConsumeHistoryAction extends BaseAction {
	
	private ConsumeHistory consumeHistory;
	
	private List<Map> consumeHistoryList;
	
	
	private IConsumeHistoryService consumeHistoryService;

	/**
	 * 初始化查询ConsumeHistory信息
	 * @author Mengxiangliang
	 * @return
	 */
	public String initSearchConsumeHistory()throws BusinessException, Exception {
		try {
		    QueryExample qe =ConditionUtil.copyConditionBySql(this.getRequest());
			PageUtil  pageutil =new PageUtil(this.getRequest());
			pageutil.setPageSize(PageUtil.PAGESIZE);
			qe.setPageUtil(pageutil);
			consumeHistoryList = consumeHistoryService.searchConsumeHistoryList(qe);
		} catch(BusinessException be){
			log.error(be);
			throw be;
		}catch(Exception e){
			log.error(e);
			throw e;
		}
		return "init_search_consumeHistory_success";
	}
	


	/**
	 * @return the consumeHistory
	 */
	public ConsumeHistory getConsumeHistory() {
		return consumeHistory;
	}

	/**
	 * @param consumeHistory the consumeHistory to set
	 */
	public void setConsumeHistory(ConsumeHistory consumeHistory) {
		this.consumeHistory = consumeHistory;
	}

	/**
	 * @return the consumeHistoryList
	 */
	public List<Map> getConsumeHistoryList() {
		return consumeHistoryList;
	}

	/**
	 * @param consumeHistoryList the consumeHistoryList to set
	 */
	public void setConsumeHistoryList(List<Map> consumeHistoryList) {
		this.consumeHistoryList = consumeHistoryList;
	}

	/**
	 * @param consumeHistoryService the consumeHistoryService to set
	 */
	public void setConsumeHistoryService(IConsumeHistoryService consumeHistoryService) {
		this.consumeHistoryService = consumeHistoryService;
	}
}
